#ifndef BUTTON_HPP
#define BUTTON_HPP

/********************************************************************
	created:	2011/01/18
	filename: 	E:\C++\Red\src\Engine\Gui\Button.hpp
	author:		Red
	
	purpose:	Generic button class. To be inherited for specialized
				buttons.
*********************************************************************/

#include "Widget.hpp"
#include "MouseListener.hpp"

namespace red {
	namespace ui {
		class Button : public Widget, public MouseListener{
		public:

			/// Sets the button's state
			void SetPressed(bool pVal) { mPressed = pVal; }

			/// Returns the button's state
			bool IsPressed() const { return mPressed; }

		protected:
			Button();

			/// MouseListener Overload
			virtual void OnMouseButtonPressed(const sf::Event::MouseButtonEvent &pEvent);

			/// MouseListener Overload
			virtual void OnMouseButtonReleased(const sf::Event::MouseButtonEvent &pEvent);

			/// MouseListener Overload
			virtual void OnMouseLeft(const sf::Event::MouseMoveEvent &pEvent);

			/// MouseListener Overload
			virtual void OnMouseEntered(const sf::Event::MouseMoveEvent &pEvent);

			/// Overloadable function, called from OnMouseButtonPressed
			virtual void OnPressed() {}

			/// Overloadable function, called from OnMouseButtonReleased
			virtual void OnReleased() {}

		private:
			bool mPressed;		///< Button state
		};
	}
}
#endif // BUTTON_HPP